reorganisation; started including graph reading code, buggy so far
merge