Working solution for Challenge.