change camera to use a class and clean up code a bit