Tex + server. Probably needs cleanup