fixed fun of sorting