add ex 2.36
use map - taking a hint from ex 2.33