A smart alarm which uses contextual information