found another off by one, starting to wonder how original code ever worked