wait option and filtering by length

implements a subset of #37