we use gtmp not tmp since tmp is double counted