Corrected error in neighbor assignment