updated documentation, minor code cleanup