repairing graph algorithm and style or links