Wrote some pseudo-pseudo-code