Added solution 5 (part 2)