The Algorithm - Segmentation Fault (Single)