More PTY codes added
Code clean-up