- making delay able to be a function