updated code and test suite.
added test files.
match origin and master