edited test function