fixed a memory leak, clean up, start work on compiling recursion