finally figured out the grep part