plugin-ified (with no off-by-one probs)