legending refactored
legends added