Code before switching to new cleaned up index