main program: added next passes + fix to the first pass