Added solution to TODO 2.b.