added sample code to demonstrate use of gradient injection