graph stuff in implementation