Changed input to use the java sort by.