added Squares and Grid functionality