Started adding code for internal memory