Added solution to TODO 2.a.