return the cost of the path
Merge pull request #5 from dominictarr/master

return the cost of the path in the result