implemented connecting line to the rectangle