Added update function for updating percentage.