add generic function example