added pseudo logic