almost done - seg fault introduced with latest change, so still need to deal with train2.txt 8-before-9 issue