penalty function was added