change code to sample code