Added a backwards for loop to get the index
going to try and write a threaded sort