Homework Try 2
Old attempt