Erlang: Insertion and SelectionSort