(for lawrence) added basic preprocessing code