small note on coding style for the future: use patternsInRange