cleaning up code and updating manuals