crap, i got a memory leak somewhere. Valgrind says 23 free out of 27 allocs