You need to add checks that step through each of the fundamental changes that happen to a cell as it goes from empty, to holding one entry, to holding more than one.