I have a problem where sometimes a cube sometimes overlap another cube or be offset one stud down. How to fix this?

Images: https://imgur.com/a/Olq8lSu

Code:

local XSise = 16
local YSize = 156
local ZSize = 16

local Stone = game.ReplicatedStorage:WaitForChild("Stone")

local function Generate(CaveValue, Ampitude, Frequency)
	for x = 0, XSise, 1 do
		for y = 0, YSize, 1 do
			for z = 0, ZSize, 1 do
				local CaveNoise = math.noise(x / 15, y / 15, z / 15) * 7
				local HeightNoise = math.noise(x / Frequency, y / Frequency, z / Frequency) * Ampitude

				HeightNoise = math.floor(HeightNoise + 0.5)

				if CaveNoise >= CaveValue or CaveNoise <= -CaveValue then
					local Block = Stone:Clone()

					Block.Parent = workspace
					Block.CFrame = CFrame.new(x * 4, (y * 4) + HeightNoise, z * 4)
				end
			end
		end
		wait()
	end
end

Generate(1.2, 10, 25)