improving documentation and code