added string boundary check

added string boundary test with tests

better error reporting

edge detection