initial rough version with shortest path added