provided sudocode applied