Squares detection working