puts at the beginning unless 0, then we don't need to track the last var