implement stopping, copy out old example code