Added optimization for PT2 with d>1 and d<=1