added comments
Added unit tests