version of number of neighbours commented out, very slow but shows how to do it