Added count method for Index