Modified to include Sorting

Sort method with java.util.Collections method. Some slight modifications
in all three methods to implement it.