ruff implementation of frame limiting