A Novel Algorithm For Inferring The Vertical Distribution Of Trace Gases Using Remote Sensing Measurements