updated pseudo-code writeup again