working on fixing substring finding
fix ugly loop, add tests to search