added tests
modified some files