Add hw 2

Code and unit tests