calculations of surrounding squares