changes for sorting