updated preprocessing