Implemented the tpa functions