Update squarefield function