stripped down and optimized alarm, should now work, but still bugs