fix alignment
use macro for sum{x_ij lambda}, add calcs