offbyone; simplify