added sample code for class-2