re- factored tests to us eunit