implementation of graph read