adjusted so that no P(A|k,k) is ever exactly 0