fixed pseudocode