corrections in penalty function and penalty energy