function that checks surrounding blocks