fixed calc_lamfinal