Added pseudocode comments