allow for pattern search, removed extra code