remove dependency on RMagic