Added solution to problem 24