implements STM/CLM (closes #18)