Type cheker partially done

mutually recursive