updated prime encoding - BC