add basic logic of linking