use intarray for interim computations when handling the counterarray