pseudocode improvments