added init function for code that needs to be called after the script has been loaded