added a size function to digraph