add documentation, fixing #327