Added meld counting and a unit test.