Finished the two sorting methods