three methods to sort