final fixes and documentation