calculate piece files