The LOFAR radio telescope measures the radio emission from extensive air showers with
unprecedented precision. In the dense core individual air showers are detected by hundreds of
dipole antennas. By fitting the complex radiation pattern to Monte Carlo radio simulation codes
we obtain measurements of the atmospheric depth of the shower maximum Xmax with a precision of $<20$ g/cm$^2$. This quantity is sensitive to the mass composition of cosmic rays.
We discuss the first mass composition results of LOFAR and the improvements that are currently being made to enhance the accuracy of future analysis. Firstly, a more realistic treatment of the atmosphere will decrease the systematic uncertainties due to the atmosphere. Secondly, a series of upgrades to the LOFAR system will lead to increased effective area, duty cycle, and the possibility to extend the composition analysis down to the energy of 10$^{16.5}$ eV.