Added TCode generating functions