remove HCTMP global variable, enhance remove temp algorithm.