Time for action – writing a function