another off by one error :(