adds func test, complete unit test