updated MTF2`

Converted MTF2 to a function