Modified pseudocode to match correct work specification