implemented sorting by: rank/name/order-in-config-file