off by one error on the codes