polished the findg function, trying out the trace pipe function