use graph_total instead of own $total variable