Added listeners for selected squares