Adding code from the walkthrough