need to move each funciton into its own file