Position was being incremented in the wrong place