updated camera code with more functions