Simplified test function, now does not need to take the function name as parameter