Added unit-tests
Added comments