working version -- idmap issues