penalty1 function

penalty1 adds an increasingly large penalty as a value approaches 1.0