\define does work now, but memleaks (why...? what isn't being freed?)