Final penalty logic implemented. Seems to be working.