Implement legend