Added solution to #27.