grr this needs to be zero-indexed all the way through