minor changes, added tests, added simple regex checks