adding C objective function