one bug fixed, but code still seg faults