Added __iter__ to metaclass to get all the elements sorted by value. Changed __repr__ to use that