get typechecker partially working. implementation is horrible