tweaking code for PT6