put codes in reasonable place
setup for tex