trying to work out the index number populating