you're still calling delay() instead of delay.  Replace all delay() statements with delay.  You also don't need to use the empty brackets in in the def statement.  I.e. use def delay instead of def delay() when no args are required