Added memory.h and updated program