fix bad merge
use clz in algorithm