Updated algorithm so that in perfect conditions, all values are zero.