added legend rank support