Final fixes

Add documentation, screw around with the variables, do some minor layout
and code fixes