Working on ternary graph