update to code. PS nodes refactored