Sorting algorithms - scratch