Loop on dictionary

Made code loop on dictionary to find objects that need updating. Need to
figure out how to determine if object is empty? Also fixed some
formatting issues.