Clean slate.

Lost of reformatting to make the code prettier and gaining a general
understanding for what it currently does.