fix graph() constructor