cleaned up camera code