Implemented TCQ (funcitoning but not fully tested)