tweaks to main funcs, formatting of output and handling incomplete bar charts