Implementing basic infrastructure for legend