added the b = 0 case and some corresponding tests