Added customized activation function

and appropriate destructors