thesis getting in shape.

only minor changes to the program.
sympy script for expansion added