added stop criterium when center moves less than half pixel (exercise sheet says 2 pixel)