msd code that should work, calculates msd over blocks, comments need to be removed later