Pre-processing the data