added memory functions and delete button