improved. Still segmentation fault.