Added solution to probelm 18