Some code added needed for postprocessing of data