refactoring to add a selection option to select which sort to run.