Formated and annotated

I changed the format around a bit to hopefully make it easier to
understand, and annotated everything.