modify raw data algorithm