typecheck works