check b value before using it as well