Use our built-in index function, rather than some hand-written nonsense.