added the alarm facility and some new features