added momory functions