added tests and code 1