preprocessing first pass