added thr.cpp