cleaned up, commented, now adds a fourth summary bar if necessary, better axis ticks