transform data to correct format