added tabs
changed T1 optmization with analytic formula