code for sdm sp models