More documentation, some rearrangements