first draft for version 2
cleaned up code
fixed the test and remove the test framework from repo