renaming function
handling overflow of the delay macro variables
delay sample fixed back