* 1.2: modified for ICOUNT number of inputs