logic and sysout changed