Make functionality added to tex and minor improvements