committing broken code: segfault/memory leaks(?)