Added a graph function; added 3 more test cases.