count index method