use a generator in betterMap