The paper presents an improved algorithm based on Bhaskara Rao and Ramesh Babu’s algorithm to invert magnetic anomalies of three-dimensional basement structures. The magnetic basement is approximated by an ensemble of juxtaposed vertical prisms whose bottom surface coincides with Curie surface with the known depth.