initial revision of Sorting.java along with small changes