Added solution for part 1 and part 2.