added direction for index based P_t and P_h_given_t