update tests and implementation