It now seems to pass a simple test of each function.