reduced mui code

using collections.Counter and itertools.izip