tweaked mo function