Added test suite, changes to findAndReplace