updates dictionary with each loop