some clean ups of code and latex