updated msd code to work with OH and H