changed sort method