added plotting and table functions