inegrated more functions from OldCodeToBeIntegrated & located what generates the segmentation fault on sdev