add some functions from cis520 and update fig2pdf