first working implementation of link command