fixed segfaulting, but still debugging correct behaviour