partial implementation of path scoring