Sorting based on value and metaclass name changed. Adding multiple inheritance support