Added an alarm mode

Also changed the random mode to be a bit smarter.