flag section and some conditions parsing added