complete obj function