added barplot code