Added legend feature.