implemented traverse using sequence and map.