finished the unification algorithm and type inference system