added graph writing for verification whether graph was correctly read