updated alarm.py to use database class