use extended regular expression for grep
added some asserts