Trying with penalty the function