Added initial simple delay handling.
So always #10 r = 1;
will now work