type derivation working pretty well.