Added solution 5 (part 1)