Converted more pseudocode to sudo code