I swear, off-by-one errors will be the death of m