Updated the example to take arguments and be more general.