Clarify some ambiguities and add documentation.