Works properly with ldc sequentially.

Also tested the beta parameter and works great, at least before
taking care of MPI.