Replace msb-table lookup w/ efficient algo