Designed to work with much larger graph and now programatically generates cycles