updating acc function