sort exercise, recursive version