added new function for graph use