added ability to generate legends