clean up some stuff, resolve memoize hash table issues