first go at msd calculation