Add logging
Add JUnit tests