second attempt now runs without segfaulting