Rearranged and documented things.