Added an as-pattern for the squared set for clarity.