Ugly, but working, find-all-matches.
Remove redundancies