Insomnia Cure  solution (Uses lot of memory: Scope of optimization)