filter target squares before calculating min/max