cleanup, removed all .tex files from repo
externalized optimization functions