updated docs, updated most code files - working, but not thoroughly tested and debugged yet