Bugfixing.
Reduced running time of genericToGraph from O(n^2) to O(n*log n).
Finetuning.