actually you can't remove items from the dict while iterating through it so keep track of who to remove and do it afterward