Conversion of main solver file up to socalled monster_loop