modified pseudocode