more changes in preparation to use igraph library