working on fixing sorting order