Final evaluator, typechecker and some modifications