add docs and various polishes