flesh out the basic typechecker some more