version2, adding test code