finish sample code