initial implementation of graph engine