Type checking almost done