Completed the solution. Ended up writing a quicksort implementation, when I could have used Java's collection sort (sigh).