building matrix with good data chucks (pieces) for before and after files