Rewriting some parts now that I'm more awake.