updated function example