#2 almost working, still getting seg faults