Edited pseudocode