added plot figure functions