implement at_least and at_most