fixed rotation and added test