first working example: corrected bug in the computeError function