moved main into its own file