some working preprocessing