Using put instead of map.replace.