selection and quick sorting fixed