added different test cases for inner higher-order function