improved the test code.
added a test code.