Added solution 6 (part 1)