use num_bp instead of magic number