Added camera functionality and code cleanup