added sudocode