Updated Preprocessing to work properly