Compiled dkg into a library. Only error is now the seg fault