randomSlice, squareUpMatrix, minor changes