sort list using recusion