organized main.js, simplified alarm functions