Converted mygrep as a function