added documentation, reorganized