exterminating raw pointers step by step. Also implements get_real_part and get_imag_part in RDM.