Working and cleaned up

Clean up comments and old code. Sort uses array[index].