completed writing 3D rotation code