beginning documentation, some small fixes along the way