Code almost working quickselect