added flag to choose whether to format or not