update of current code to make it complient with GraphX standards and work on other types of graphs