more progress in the type system
diff
diff 1
diff 2