Sometimes i have a very hard time going to sleep, and i am at what i call the middle ground. Some random thoughts go through my mind while i try to sleep and sometimes i think of problems and get to something like a solution. Usually its just a subconscious hint that i understand in the morning after thinking about it. But i don't remember my dreams, so i rarely get to solutions in my sleep, just some hints in my middle ground. But who knows, maybe i get some work done and don't know it.