Update tpa.cpp in dpa