Exercise 2, added index count