Changing code to better reflect slides