fixed bug where neighbours from previous and above square were not being intersected correctly, and tweaked some neighbour weightings. Also tidied up some code by removing fluff and fixing built-in constant cases (NULL to null)