Finished imperative basic version quick sort