added docs and small adjustments