updated TTD, added pms for calc_p_doc