Simplified the Legend functionality
Updated the Legend funcionality