* updated the test program with error checking