Legacy code alarm exercise solution