cleared some memory leaks, thinking of implementing a JIT