Completed STM example