modularizing findsequences