Reproducible resistive switching in nonvolatile organic memories