some minor improvements and more documentation added