Re wrote the code example