non good, but better code for ps6 - updates and refactor