add some code to decode history files