def adjustHF(H, F, n_new, n_old):
    """
    adjust hit/false alarm rate for ceiling effects
    according to Macmillan&Creelman, pp8
    urut/nov06
    """
    if H == 1:
        H = 1 - 1 / (2 * n_old)
    if F == 1:
        F = 1 - 1 / (2 * n_new)
    if H == 0:
        H = 1 / (2 * n_old)
    if F == 0:
        F = 1 / (2 * n_new)
    return H, F
