finished the code sample