A Galactic model of stellar population synthesis is used along with a genetic algorithm to reconstruct the three dimensional dust distribution in the Milky Way. We have applied this technique towards over 1500 IRDC cloud candidates, for which we recovered distances and masses for 1259 of them. Aside from giving us the distance to the dust, the three dimensional extinction map also provides us with a temperature independent measure of its density. This new method is independent of any kinematical information, thus providing a new way to obtain information on the Galactic distribution of the ISM. It is a good complement to existing measures which are solely based on molecular gas kinematics as both methods are completely independent and both are affected by different systematics. It will be able to provide valuable distance information for use in the analysis and interpretation of far-infrared and sub-millimetre observations by Herschel and Planck. In the future it could be used with deeper stellar observations or observations at longer wavelengths in order to probe even higher density clouds and to even larger distances.