Added semi-pseudo-code. Ha.