Figure 4:
Punishment subroutine.