added unit code test.