More working-er version with a built-in test if executed directly rather than imported...