implemented array based counting algorithm. turned up an inconsistency in the count numbers.