additional changes to Rotation.cpp related to sorting