GT pseudo code