added destructor to graph. Fixed outstream in timeLength