moved multimap function