cleaned up TeX code