This is just a question that I have wanted to ask for a while.

While reading through the forums, I have heard people talking about their lucid dreams that they had during an afternoon nap, and this got me thinking... Since REM sleep takes place around 5-6 hours after being asleep, and since dreaming only happens during REM sleep, how is dreaming during an afternoon nap possible?