barebones but working tpfahp,tpdahp twfahp via test cases