How do you construct a merit function?