updated preproc & analysis functions