basic parser working (with almost certain memory leak)