Might the ,SMART do what you need here?