Working version

updated plotting functions, improved .tex output