updated tests and code