fixed outlying global variable 'neighbors'