simplified increment function a little bit