(wip) Turns out that the penalty terms require more thinking and have bugs