Add loop to run mutiple times for computing errror