First draft of type checking