added flash memory functionalities