Logic improvement.

Fixed a would-be issue, demonstration of a dynamic sleep.
Merge pull request #1 from Pse-udo/master

Fix example