Funtion to check neighbours