working on adifferent method of constructing graphs