detecting squares