break calculation and file separation