adding more tests, made some fixes, deleted some unused code