added missing + 1 and some clean up