added new test files and updated build
new tests and several optimizations