Fixed bug in rotational code