moved camera code into its own function