use StatMachine library to calculate first half record