Changed AreBuildingsLinked function to account for link direction