Wrote rotation matrix code