public void redoSquares() {
		for (int y = 0; y < squares.length; y++) {
			for (int x = 0; x < squares[y].length; x++) {
				/*for (int a = 0; a < squares[y][x].length; a++) {
					squares[y][x][a] = null;
				}*/
				sqSizes[y][x] = 0;
			}
		}

		int start = sliceStart * squareSize;
		int end = (sliceStart + sliceWidth) * squareSize;
		for (int i = 0; i < atoms.length; i++) {
			Atom at = atoms[i];
			if (at.x >= start && at.x < end) {
				int y = ((int) at.y) / squareSize;
				int x = ((int) at.x) / squareSize - sliceStart;
				squares[y][x][sqSizes[y][x]++] = at;
				if (sqSizes[y][x] == squares[y][x].length) {
					Atom[] as = squares[y][x];
					Atom[] newAs = new Atom[as.length * 2];
					System.arraycopy(as, 0, newAs, 0, as.length);
					squares[y][x] = newAs;
				}
			}
		}
	}