format output & add mode swither