Filled in TODO1 and 2 from the scaffolded code