2nd pass type checking