fixing negative initial iteration bug