We adapt Guths polynomial partitioning argument for the Fourier restriction problem to the context of the Kakeya problem. By writing out the induction argument as a recursive algorithm, additional multiscale geometric information is made available. To take advantage of this, we prove that direction-separated tubes satisfy a multiscale version of the polynomial Wolff axioms. Altogether, this yields improved bounds for the Kakeya maximal conjecture in $mathbb{R}^n$ with $n=5$ or $nge 7$ and improved bounds for the Kakeya set conjecture for an infinite sequence of dimensions.