First working solution.