Time for action – Writing a function