added most of the documentation