added rough energy function to figure 2.  some other preceding changes.