Added toEntries and __len__