added map2vmp function