Put the samples into the correct format