minor changes to pseudocode