changing method get_rep to find (find a pattern in a table)