Added newGraphOfType cuntion