added barchart function, fixed plots