Algorithm A6: Insomnia