A single-electron analysis of NAND flash memory programming