part 1

do the preprocessing up to the 5th step