removed continue_flag, not using it