imrpoved documentation
added pathLenght calculation