modify error function to negative for maximizing it in optimization