tex refactor in progress
working on 3