Function amended to add an argument.