More flexibility for delay function