Initial working MT version. Not tested very well.