update- more tests and implementation