Preprocessing the data