msd version of train query