ported maps function