Update sh_specdm.lua

Included a few helper functions to make life easier.