code for the contagion model for nonproliferation