Updated writeup, mainly pseudo-code
More writeup updates