Added for loop so that voltage correction runs every loop cycle