Completed the automatic trig simplification algorithm. Need to debug