valgrind shows no leaks, 0 errors from 0 contexts; fixed 'uninitialized variable' warning