brought over the improvements from the what-if gadget