added code sample for test function