Revert "rewrite tc3.cpp"

This reverts commit 0c381b05e1f1ae794d472e0814e851b8342f8fe1.