complete function 'countLB2'