translated many parts of native code to managed