fix the rotation and height computation