method to put in map<var, map<key,val>>