commit of the functional version of the selection sort