tests and add a final typefunction