connecting an existing link to the last created new link
merged from upstream
moved some stuff around