ki calculation for more general hypotheses
bug