added custom grep function