User documenation, taken from existing code and some rewritten.