Finished part2: now removes null check from graph