Code no longer aborts/SEGFAULTS