changed size of patches. Made setupLinksAndNodes more dynamic.
fixed bug in adjustCorrespondingEndPoint