find first in map reimplemented and now less biased