resolve the corner problem with walls