fixed to use HB_SIZE instead of int