first pass of updating alpha

todo: double check math
debug nans
adds energy in separate file