No more memory Issues!

Algorithm fixed. The ampersand was the death of us… Test case now
encapsulates 1000 test cases.