sample code from working through sorting algorithms with students at turing