Adding graph() method