finished code to find path in graph and output directions