Ported the camera code