Two solutions for problem #16