visibilityGraph O(n^3). working version