adding version in which the leds are set directly from the counter bits