Added map function to Tree