fix bug: line sum should be 1