Cleaned up the code slightly. Almost ready to integrate the projector