update grep file to function and other small updates