Enable reading a gml file
Merge in Marco's changes for random permutation