Changed time loop end to nt from nt/2