adding 'rotate' function