buf is the output file that we will send to the cube