working on objective function