refactor barchart with objects
This is like, half working. Grrr.