refactor loss calculation
bug fix out of bound access for next hyper-graph
bug fix for monontone at punctuation