Modified for Map, instead of list.