small changes to preprocessing part