update code to match slides