added an output feature to the test program