Added an indexing method.