updated camera code so it passes unit tests