nil replaced by row-average