Working

Doing the real work. De-spahgettified code!