added time sorting to bar_graph stuff