small changes
c-code for error function