Added path Cost method and some comments