added test to find self link
removed unnecessary code