Sorting algorithm attempts in Java