Updating neighbor logic with proper conditionals.