Added toString() to directed graph and other minor changes