No need of using an array of objects. Got the index func to work.