terminate() added

closes #3