updates to code and pseudocode