Look at using the each_with_index method instead here.