I have added an example implementation below this line.