Complete map function and integration