Added  function to reIndex