fix a bug in map
faster delete-duplicates for long lists