moved code to grep