fixed up index method