solution for challenge 190 intermediate