Better link figuring out logic