updated documentation. fix some tests