Merge pull request #9 from chusnen/master

Generate_history
generate_history refined