using python style iteration through dictionary instead of ruby