Insertion and shell sort completed by Peter.