functions for processRawData