Finished recursive algorithm to run in nlgn time
added additional tests for helper function and correctness