Added rough generate_history_table function.