some progress with type checking. far from finished, but in a good 'work in progress' state