tex additions, code edits for style