added link() method
added test for link() method