moving the squares to index