Remainder of functions added, running results in segmentation fault