documentation added and minor fixes