added basic preprocessing