Square calculations