Reduced memory usage while filling zeros