addressing an off by one error