build four direction blocking logic