cleaned up the Sort class