added nonrecursive method (takes ~77% time of recursive method), fixed bug where the forward text was being used for reverse precomputed data