gdb saves the day once again, at least it isn't segfaulting. not function atm