Updated objFunction

objFunction now accepts a mask as an argument.