added stdin support for path finding, improved unvisited vertex
retrieval