reorganized and documented