added basic grep function for manual mode