add map functionality using fold