modification to pseudocode