Copy-pasted code to find length of every sequence in a mfa