edits up to 3.1 penalty functions