seg fault, awaiting assistence from @Veedrac