Adding current algorithm