split psoup.cpp and added p1_base finished_writing