Updates Code and fixes bug with rotation.