clean up pseudocode