Added PTL, minor optimizations