maybe this will be obvious once you add a comment for what P means, but from looking at this now it's not clear to me why we don't want to consume bases if cigar element is P. (I'm sure your code is right -- I'm just saying it's not clear to me why this is the right thing.)