I had thought the formulas I used were for airburst but I will need to double check that.(Edit checked and they do appear to be the optimum altitude formulas). I am going to redo a good portion of the math anyway.
I originally took the formulas from
http://www.carloslabs.com/node/16
But now they have improved it to include overpressure and fallout. Guess I have more work in front of me.
http://www.carloslabs.com/node/20