Rotate function Implemented

Needs more work/tweak, however it does work.