added init code and found out that clang doesnt work with gdb. I should have realized that before spending 30 min debugging stuff. sigh.