More efficient, but only returns first solution.