This "demo" code should probably be implemented as a unit test