the msd is now calculated dynamically, without saving all results and averaging them