update code & add new tests