Added all the functions necessary for the pre-processing workflow