Moving init function to run script