There are currently over 33,000 clinical trials being conducted worldwide according to the registry clinicaltrial.gov. These are very expensive, often costing tens or even hundreds of millions of dollars. Thus even small improvements in efficiency are worthwhile. The larger trials are monitored for efficacy, safety and futility by an independent panel. This panel will include one or more statisticians along with clinical experts, basic scientists and ethicists. We explain how the properties of stopping boundaries can be calculated numerically and how to optimize boundaries to minimize expected sample size, while controlling type I and II error probabilities. Our optimization procedure involves the use of dynamic programming (DP) to solve a Bayes decision problem with no constraint on error rates. This conversion to an unconstrained problem is equivalent to using Lagrange multipliers. Finally, iterative nonlinear optimization techniques are employed to obtain the optimal solution to the original constrained problem via successive applications of the DP procedure. The same methods can be employed to derive optimal designs in a newly proposed broader class of adaptive procedures, in which future group sizes can be re-defined as the trial proceeds based on accruing data. We conclude that the added benefit is quite small and arguably not worth the considerable extra logistical and integrity problems that can result.