modified TPCF_serial to make an angular version