updated code to support M10i dual RE; should work for all M-series