add map and function