Correct seg faults todo with pointers