compute fragment lengths