updating core and adding some memory management