createblock function