refactored main. moved code related to camera to own class. main now using this camera class.