added transitive reduction and a new data structure