re-wrote data process part