Added a erase all function & corrected one bug in the Write function