Code after reading the chapter. Things are not working as parts are obviously missing.