added getTotalRotation() function